// styles/popup.scss
// 统一弹窗样式 - 驾驶舱风格

// 弹窗基础样式
.cockpit-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #152236;
  border-radius: 16px;
  z-index: 10000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(32, 100, 200, 0.1),
    inset 0 0 20px rgba(0, 60, 120, 0.2);

  // 蓝白色渐变边框
  &::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
      135deg,
      #4dabff 0%,
      #1890ff 25%,
      #096dd9 50%,
      #0050b3 75%,
      #003a8c 100%
    );
    border-radius: 18px;
    z-index: -1;
    animation: borderGlow 3s ease-in-out infinite alternate;
  }

  // 内发光效果
  &::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    background: rgba(21, 34, 54, 0.95);
    border-radius: 15px;
    z-index: -1;
  }
}

// 弹窗内容区域
.cockpit-popup-content {
  position: relative;
  z-index: 1;
  padding: 24px;
  color: #e6f7ff;
  font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;

  // 标题样式
  .popup-title {
    margin: 0 0 20px 0;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    background: linear-gradient(135deg, #8bc6ff 0%, #4dabff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  // 内容区域
  .popup-body {
    margin-bottom: 24px;

    p {
      margin: 12px 0;
      font-size: 16px;
      line-height: 1.6;
      color: #bae7ff;

      &:last-child {
        margin-bottom: 0;
      }
    }

    .data-number {
      font-size: 28px;
      font-weight: bold;
      color: #69c0ff;
      text-shadow: 0 0 10px rgba(105, 192, 255, 0.5);
    }
  }
  //标题和关闭
  .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
  }
  .popup-title {
    color: #bae7ff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex: 1;
  }

  // 按钮区域
  .popup-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
  }
}
.close-btn {
  background: none;
  border: none;
  color: #bae7ff;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.3s;
  background: rgba(5, 64, 128, 0.8);
  &:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }
}
// 弹窗按钮样式
.cockpit-popup-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;

  &::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent
    );
    transition: left 0.5s;
  }

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.1);

    &::before {
      left: 100%;
    }
  }

  &:active {
    transform: translateY(0);
  }

  // 次要按钮
  &.secondary {
    background: linear-gradient(135deg, #434343 0%, #262626 100%);

    &:hover {
      box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    }
  }
}

// 边框发光动画
@keyframes borderGlow {
  0% {
    opacity: 0.8;
    box-shadow: 0 0 20px rgba(77, 171, 255, 0.6),
      0 0 40px rgba(24, 144, 255, 0.4);
  }
  100% {
    opacity: 1;
    box-shadow: 0 0 30px rgba(77, 171, 255, 0.8),
      0 0 60px rgba(24, 144, 255, 0.6);
  }
}

// 响应式设计
@media (max-width: 768px) {
  .cockpit-popup {
    width: 90vw !important;
    max-width: 400px !important;
  }

  .cockpit-popup-content {
    padding: 20px;

    .popup-title {
      font-size: 20px;
    }

    .popup-body {
      .data-number {
        font-size: 24px;
      }
    }
  }
}
